A1 = readmatrix('NiI2_CPGE_POL_680nm_-24V_30K.csv')

% note: the angle should be flipped, as the cryostat was rotated by 45 deg.
x1 = A1(1:135,1)/360*2*pi
y1 = A1(1:135,2)*1e12+0.05

a = -0.02431
b = -0.1331
c = -0.1888
d = 1.42818

f1 = a*sin(4*x1)+b*cos(4*x1)+c*sin(2*x1)+d

hold on

plot(x1,f1,'Linewidth',2,'Color',[0 0 0.8])
scatter(x1,y1,10,[0 0 0.8],'filled')
xlabel('Polarization')
ylabel('Photocurrent [pA]')
xlim([0, pi])
ylim([1.15,1.85])
xticks(0:pi/4:pi)
yticks(1.2:0.3:1.8)
xticklabels({'0','pi/4','pi/2','3pi/4','pi'})
%set(gca,'XMinorTick','on','YMinorTick','on')
set(gca,'box','on','Xcolor',[0 0 0],'Ycolor',[0 0 0])
hold off

set(gcf,'Position',[0, 0, 197, 110])